from django.db import models

# Create your models here.


class Person(models.Model):
    name = models.CharField(max_length=16)
    age = models.IntegerField(default=18)
    sex = models.BooleanField(default=False)
    hobby = models.CharField(max_length=32, null=True, blank=True)

    @classmethod
    def create(cls, name, age=19, sex=False, hobby='唱跳'):
        cls.name = name
        cls.age = age
        cls.sex = sex
        cls.hobby = hobby


class User(models.Model):
    name = models.CharField(max_length=16)
    password = models.CharField(max_length=255)
